with open("normal-result.txt", "r") as file1, open("CM-K-result.txt", "r") as file2:
    lines1 = file1.readlines()
    lines2 = file2.readlines()
ip_diff_count = 0  # 记录有差距的IP数量
for line1, line2 in zip(lines1, lines2):
    ip1, estimate1 = line1.strip().split(", ")
    ip2, estimate2 = line2.strip().split(", ")
    ip1 = ip1.split(": ")[1]
    estimate1 = estimate1.split(": ")[1]
    ip2 = ip2.split(": ")[1]
    estimate2 = estimate2.split(": ")[1]
    if ip1 == ip2 and estimate1 != estimate2:
        diff = int(estimate2) - int(estimate1)
        print(f"源IP: {ip1}, 估计值差距: {diff}")
        ip_diff_count += 1
print(f"总共有 {ip_diff_count} 个IP的估计值有差距")
